package com.ruoyi.deeplearn.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.deeplearn.mapper.DeepDatasetTypeMapper;
import com.ruoyi.deeplearn.domain.DeepDatasetType;
import com.ruoyi.deeplearn.service.IDeepDatasetTypeService;

/**
 * 数据集类型Service业务层处理
 * 
 * @author 任伟伟
 * @date 2022-12-10
 */
@Service
public class DeepDatasetTypeServiceImpl implements IDeepDatasetTypeService 
{
    @Autowired
    private DeepDatasetTypeMapper deepDatasetTypeMapper;

    /**
     * 查询数据集类型
     * 
     * @param typeId 数据集类型主键
     * @return 数据集类型
     */
    @Override
    public DeepDatasetType selectDeepDatasetTypeByTypeId(Long typeId)
    {
        return deepDatasetTypeMapper.selectDeepDatasetTypeByTypeId(typeId);
    }

    /**
     * 查询数据集类型列表
     * 
     * @param deepDatasetType 数据集类型
     * @return 数据集类型
     */
    @Override
    public List<DeepDatasetType> selectDeepDatasetTypeList(DeepDatasetType deepDatasetType)
    {
        return deepDatasetTypeMapper.selectDeepDatasetTypeList(deepDatasetType);
    }

    /**
     * 新增数据集类型
     * 
     * @param deepDatasetType 数据集类型
     * @return 结果
     */
    @Override
    public int insertDeepDatasetType(DeepDatasetType deepDatasetType)
    {
        deepDatasetType.setTypeId(IdUtil.getSnowflakeNextId());
        deepDatasetType.setCreateTime(DateUtils.getNowDate());
        return deepDatasetTypeMapper.insertDeepDatasetType(deepDatasetType);
    }

    /**
     * 修改数据集类型
     * 
     * @param deepDatasetType 数据集类型
     * @return 结果
     */
    @Override
    public int updateDeepDatasetType(DeepDatasetType deepDatasetType)
    {
        deepDatasetType.setUpdateTime(DateUtils.getNowDate());
        return deepDatasetTypeMapper.updateDeepDatasetType(deepDatasetType);
    }

    /**
     * 批量删除数据集类型
     * 
     * @param typeIds 需要删除的数据集类型主键
     * @return 结果
     */
    @Override
    public int deleteDeepDatasetTypeByTypeIds(Long[] typeIds)
    {
        return deepDatasetTypeMapper.deleteDeepDatasetTypeByTypeIds(typeIds);
    }

    /**
     * 删除数据集类型信息
     * 
     * @param typeId 数据集类型主键
     * @return 结果
     */
    @Override
    public int deleteDeepDatasetTypeByTypeId(Long typeId)
    {
        return deepDatasetTypeMapper.deleteDeepDatasetTypeByTypeId(typeId);
    }
}
